package org.fas.ui
{
	import flash.display.SimpleButton;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import flash.text.TextField;

	public class FAlert extends Sprite
	{
		private var txt:TextField;
		private var close:SimpleButton;
		public var lisClose:Function;
		public function FAlert()
		{
			super();
			init();
		}
		private function init():void{
			txt = this.getChildByName("mc_txt") as TextField;
			close = this.getChildByName("mc_close") as SimpleButton;
			this.visible = false;
		}
		public function build(_str:String):void{
			txt.text = _str;
			this.visible = true;close.addEventListener(MouseEvent.CLICK,closeHandle);
		}
		private function closeHandle(_e:MouseEvent=null):void{
			if(lisClose!=null){
				lisClose();
			}
			this.visible = false;close.removeEventListener(MouseEvent.CLICK,closeHandle);
		}
	}
}